package graphics.objects;
import graphics.system.Color;
import graphics.system.GLTools;
import physics.Body;
import physics.joints.JBackgroundDistanceJoint;
import physics.joints.Joint;
import physics.joints.TwoBodyJoint;
import tools.Point;
public class GStupidLine extends GraphicsObject {
	Point p1, p2;
	public GStupidLine(Point p1, Point p2, float angle, Color color) {
		super(p1, angle, color);
		this.p1 = p1;
		this.p2 = p2;
	}
	@Override
	public void draw() {
		GLTools.drawLine(p1, p2, Color.blue);
	}
	@Override
	public void delete() {
	}
	@Override
	public void syncToBody(Body b, Point offset, float angle) {
		// Cannot sync line to body?
		assert (false);
	}
	@Override
	public void syncToJoint(Joint j) {
		if (j instanceof TwoBodyJoint) {
			p1 = j.getP1();
			p2 = ((TwoBodyJoint) j).getP2();
		}
		if (j instanceof JBackgroundDistanceJoint) {
			p1 = j.getP1();
			p2 = ((JBackgroundDistanceJoint) j).getP2();
		}
	}
}
